package com.xjc.log;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

/**
 * @author:谢君臣
 * @Date:2021/6/6-9:23
 * @version:1.0
 * @function:
 */
@Component
@Aspect
public class SystemLog {

    @Before("execution(* com.xjc.service..*.*(..))")
    public void before(){
        System.out.println("执行了方法：");
    }
    public void afterReturning(Object returnValue, Method method, Object[] objects, Object o1) throws Throwable {
        System.out.println(o1.getClass().getName() + "执行了方法：" + method.getName()+",返回结果为："+returnValue.toString());
    }
}
